﻿using System;
using System.Globalization;
using Avalonia.Data.Converters;

namespace MinecraftEnchantCalculator.Converters.Xaml;

public class FeasibleConverter : IValueConverter
{
  public object? Convert(
    object? value, Type targetType, object? parameter, CultureInfo culture
  )
  {
    if (value is int expMax) return expMax <= 38 ? "可行" : "过于昂贵";

    return "未知错误";
  }

  public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
  {
    throw new NotImplementedException();
  }
}